package com.shanghaionstar.notification.bean;

import org.json.JSONException;
import org.json.JSONObject;

import java.io.Serializable;


public class XMPPMessage implements Serializable {

	private static final long serialVersionUID = 1L;
	private String msg;
	private String jumpFlag = "2";
	private String link = "";
	
	private String receiveType;
    private String title;
    private String content;

	
	public String getLink() {
		return link;
	}

	public void setLink(String link) {
		this.link = link;
	}

	public String getReceiveType() {
		return receiveType;
	}

	public void setReceiveType(String receiveType) {
		this.receiveType = receiveType;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getContent() {
		return content;
	}

	public void setContent(String content) {
		this.content = content;
	}

	public String getMsg() {

		return msg;
	}

	public String getJumpFlag() {
		return jumpFlag;
	}

	public void setJumpFlag(String jumpFlag) {
		this.jumpFlag = jumpFlag;
	}

	public XMPPMessage parseResponse(String json) {
		try {
			JSONObject obj = new JSONObject(json);
			msg = obj.getString("body");
			jumpFlag = obj.getString("receiveType");
			link = obj.getString("link");
		} catch (JSONException e) {
			e.printStackTrace();
		}
		return this;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}
}
